widget: Avoid casting event coordinates to int in contains()
authorTimm Bäder <mail@baedert.org>
Thu, 4 Jan 2018 17:25:55 +0000 (18:25 +0100)
committerTimm Bäder <mail@baedert.org>
Thu, 4 Jan 2018 20:41:35 +0000 (21:41 +0100)
gtk/gtkwidget.c

index 02e651a9a7c59235e0af2d57395bc63f639db50e..af4b3c7ae32f738b1f308007bbfda3c67d42c6ed 100644 (file)
@@ -911,11 +911,14 @@ gtk_widget_real_contains (GtkWidget *widget,
                           gdouble    y)
 {
   GtkAllocation own_alloc;
+  graphene_rect_t widget_bounds;
 
   gtk_widget_get_own_allocation (widget, &own_alloc);
-  
+  graphene_rect_init (&widget_bounds, own_alloc.x, own_alloc.y, own_alloc.width, own_alloc.height);
+
   /* XXX: This misses rounded rects */
-  return gdk_rectangle_contains_point (&own_alloc, x, y);
+  return graphene_rect_contains_point (&widget_bounds,
+                                       &(graphene_point_t){x, y});
 }
 
 static GtkWidget *